package org.systemsbiology.addama.sequencing.util;

import java.util.Hashtable;
import java.util.HashMap;

import org.json.JSONObject;
import org.json.JSONArray;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Iterator;

/**
 * Created by IntelliJ IDEA.
 * User: jlin
 * Date: Sep 15, 2010
 * Time: 9:54:02 AM
 * To change this template use File | Settings | File Templates.
 */
public class CGSChromRefMap {

    public static HashMap<String, String> chromRefMap = new HashMap<String, String>();

    public static HashMap<String, String> chromNameMap = new HashMap<String, String>();

    public static void initChromMaps() {
        /*
        S288C_chr01.fa	NC_001133.7	-
S288C_chr02.fa	NC_001134.7	-
S288C_chr03.fa	NC_001135.4	-
S288C_chr04.fa	NC_001136.8	-
S288C_chr05.fa	NC_001137.2	-
S288C_chr06.fa	NC_001138.4	-
S288C_chr07.fa	NC_001139.8	-
S288C_chr08.fa	NC_001140.5	-
S288C_chr09.fa	NC_001141.1	-
S288C_chr010.fa	NC_001142.7	-
S288C_chr011.fa	NC_001143.7	-
S288C_chr012.fa	NC_001144.4	-
S288C_chr013.fa	NC_001145.2	-
S288C_chr014.fa	NC_001146.6	-
S288C_chr015.fa	NC_001147.5	-
S288C_chr016.fa	NC_001148.3	-
S288C_chr017.fa	J01347.1	2u
S288C_chr018.fa	NC_001224.1	mito
         */
        chromRefMap.put("1", "NC_001133.7");
        chromRefMap.put("2", "NC_001134.7");
        chromRefMap.put("3", "NC_001135.4");
        chromRefMap.put("4", "NC_001136.8");
        chromRefMap.put("5", "NC_001137.2");
        chromRefMap.put("6", "NC_001138.4");
        chromRefMap.put("7", "NC_001139.8");
        chromRefMap.put("8", "NC_001140.5");
        chromRefMap.put("9", "NC_001141.1");
        chromRefMap.put("10", "NC_001142.7");
        chromRefMap.put("11", "NC_001143.7");
        chromRefMap.put("12", "NC_001144.4");
        chromRefMap.put("13", "NC_001145.2");
        chromRefMap.put("14", "NC_001146.6");
        chromRefMap.put("15", "NC_001147.5");
        chromRefMap.put("16", "NC_001148.3");
        chromRefMap.put("2u", "J01347.1");
        chromRefMap.put("mito", "NC_001224.1");

        chromRefMap.put("chrI", "NC_001133.7");
        chromRefMap.put("chrII", "NC_001134.7");
        chromRefMap.put("chrIII", "NC_001135.4");
        chromRefMap.put("chrIV", "NC_001136.8");
        chromRefMap.put("chrV", "NC_001137.2");
        chromRefMap.put("chrVI", "NC_001138.4");
        chromRefMap.put("chrVII", "NC_001139.8");
        chromRefMap.put("chrVIII", "NC_001140.5");
        chromRefMap.put("chrIX", "NC_001141.1");
        chromRefMap.put("chrX", "NC_001142.7");
        chromRefMap.put("chrXI", "NC_001143.7");
        chromRefMap.put("chrXII", "NC_001144.4");
        chromRefMap.put("chrXIII", "NC_001145.2");
        chromRefMap.put("chrXIV", "NC_001146.6");
        chromRefMap.put("chrXV", "NC_001147.5");
        chromRefMap.put("chrXVI", "NC_001148.3");
        chromRefMap.put("2-micron", "J01347.1");
        chromRefMap.put("2micron", "J01347.1");
        chromRefMap.put("chrM", "NC_001224.1");


        chromNameMap.put("chr1", "chrI");
        chromNameMap.put("chr2", "chrII");
        chromNameMap.put("chr3", "chrIII");
        chromNameMap.put("chr4", "chrIV");
        chromNameMap.put("chr5", "chrV");
        chromNameMap.put("chr6", "chrVI");
        chromNameMap.put("chr7", "chrVII");
        chromNameMap.put("chr8", "chrVIII");
        chromNameMap.put("chr9", "chrIX");
        chromNameMap.put("chr10", "chrX");
        chromNameMap.put("chr11", "chrXI");
        chromNameMap.put("chr12", "chrXII");
        chromNameMap.put("chr13", "chrXIII");
        chromNameMap.put("chr14", "chrXIV");
        chromNameMap.put("chr15", "chrXV");
        chromNameMap.put("chr16", "chrXVI");
        chromNameMap.put("2-micron", "2micron");
        chromNameMap.put("chrM", "chrM");

    }

    public static void main(String[] args) {
        JSONObject jo = new JSONObject();
        try {
            jo.put("keya", "a");
            jo.put("keyb", "b");
            jo.put("keyc", "c");
            Iterator k = jo.keys();
            while (k.hasNext()) {
                Object key = k.next();
                System.out.println("Key:" + key + " val:" + jo.getString(key.toString()));
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
